Given an m x n board of characters and a list of strings words,
return all words on the board. Each word must be constructed
from letters of sequentially adjacent cells, where adjacent cells are
horizontally or vertically neighboring. The same letter cell may not
be used more than once in a word.
Input: board = [["o","a","a","n"],["e","t","a","e"],["i","h","k","r"],
["i","f","l","v"]], words = ["oath","pea","eat","rain"]
Output: ["eat","oath"]
13. Design Add and Search Words
Data Structure
WordDictionary() Initializes the object.
void addWord(word) Adds a word to the data structure, it can
be matched later.
bool search(word) Returns true if there is any string in the data
structure that matches the word or false otherwise. A word may
contain dots '.' where dots can be matched with any letter.
Design a data structure that supports adding new words and
finding if a string matches any previously added string.
Implement the WordDictionary class:
Input:["WordDictionary", "addWord", "addWord", "addWord",
"search", "search", "search", "search"]
[[],["bad"],["dad"],["mad"],["pad"],["bad"],[".ad"],["b.."]]
Output: [null, null, null, null, false, true, true, true]
14. Word Search II
PRACTICE NOW
PRACTICE NOW
22